Skip to content

Add forward ecall with framed preconditions#937

Merged
strub merged 2 commits intomainfrom
call-fwd-auto-frame
Apr 9, 2026
Merged

Add forward ecall with framed preconditions#937
strub merged 2 commits intomainfrom
call-fwd-auto-frame

Conversation

@strub
Copy link
Copy Markdown
Member

@strub strub commented Mar 12, 2026

This extends ecall to support forward calls on Hoare goals via ->>, while keeping backward behavior for existing uses.

It refactors call postcondition generation into reusable helpers, adds proof-term/program-variable substitution utilities needed to instantiate contracts cleanly, and checks that the supplied contract matches the targeted procedure(s). For forward Hoare calls, the tactic now automatically frames precondition conjuncts that are independent of the call’s writes.

A regression test is added in tests/forward-call.ec.

@strub strub self-assigned this Mar 12, 2026
@strub strub force-pushed the call-fwd-auto-frame branch 2 times, most recently from 37e7523 to 6a9a23a Compare March 16, 2026 10:38
@strub strub force-pushed the call-fwd-auto-frame branch 15 times, most recently from 4c5c754 to 28232e6 Compare March 20, 2026 21:02
@strub strub marked this pull request as ready for review March 20, 2026 21:17
@strub strub force-pushed the call-fwd-auto-frame branch from 28232e6 to 6a4af9b Compare March 20, 2026 21:35
@strub strub changed the title Forward call with framed pre Add forward ecall with framed preconditions Mar 20, 2026
@strub strub force-pushed the call-fwd-auto-frame branch 3 times, most recently from cf9b1d9 to 335c058 Compare March 27, 2026 14:40
@strub strub force-pushed the call-fwd-auto-frame branch 2 times, most recently from ea09c5f to 24429a8 Compare April 8, 2026 11:51
This extends ecall to support forward calls on Hoare goals via ->>, while
keeping backward behavior for existing uses.

It refactors call postcondition generation into reusable helpers, adds
proof-term/program-variable substitution utilities needed to instantiate
contracts cleanly, and checks that the supplied contract matches the targeted
procedure(s). For forward Hoare calls, the tactic now automatically frames
precondition conjuncts that are independent of the call’s writes.

A regression test is added in tests/forward-call.ec.
@strub strub force-pushed the call-fwd-auto-frame branch from 24429a8 to 14239e6 Compare April 8, 2026 12:01
@Gustavo2622 Gustavo2622 self-requested a review April 8, 2026 16:29
Comment thread src/phl/ecPhlCall.ml
Add comments detailing the inference rules implemented by
t_ecall_hoare_fwd and t_ecall_hoare_bwd in ecPhlExists.ml.
@strub strub requested a review from Gustavo2622 April 9, 2026 07:11
@strub strub added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit bb95fdd Apr 9, 2026
16 checks passed
@strub strub deleted the call-fwd-auto-frame branch April 9, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants